<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../static/jquery-easyui-1.5.5.3/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../static/jquery-easyui-1.5.5.3/themes/bootstrap/easyui.css"/>
<link rel="stylesheet" type="text/css" href="../static/jquery-easyui-1.5.5.3/themes/icon.css"/>
<script type="text/javascript" src="../static/jquery-easyui-1.5.5.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/jquery-easyui-1.5.5.3/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
$(function(){
	$("#phone").numberbox({
		width: 200,
		missingMessage:'电话必填'
	});
	$("#name").textbox({
		width: 200,
		missingMessage:'租户名称必填'
	});
	$("#linkman").textbox({
		width: 200,
		missingMessage:'联系人必填'
	});
	$("#username").textbox({
		width: 200,
		missingMessage:'电话必填'
	});
	$("#password").textbox({
		width: 200,
		missingMessage:'电话必填'
	});
	
	$("#btn_1").click(function(){
		var phone = $("#phone").val();
		var name = $("#name").val();
		var linkman = $("#linkman").val();
		var username = $("#username").val();
		var password = $("#password").val();
		var f = false;
		if(phone == "" || phone == ""){
			alert("请输入电话！");
		}else if(name == "" || name == null){
			alert("请输入租户名称！");
		}else if(linkman == "" || linkman == null){
			alert("请输入联系人")
		}else if(username == "" || username == null){
			alert("请输入管理员电子邮箱");
		}else if(password == "" || password == null){
			alert("请输入管理员密码");
		}else {
			$.post('gly', {password: password, username: username}, function(data){
				if(data){
					var form = $('#myform').serialize();
					window.location.href="save?"+form;
				}else{
					alert("管理员电子邮箱或密码错误")
				}
			});
		}
	})
});
</script>
<style type="text/css">
div label{
	display: inline-block;
	width:160px;
	text-align: right;
}
</style>
</head>
<body>
	<div style="margin-top: 50px; width: 68%;"modal="true">
		<form action="save" id="myform" method="post">
			<div style="margin-left: 400px;">
				<div>
				<label for="user">电话：</label><input type="text" name="phone"  id = "phone" class="easyui-validatebox" placeholder="电话">
				</div>
				<div style="margin-top: 30px;">
					<label for="pass">租户名称：</label><input type="text" name="name" id = "name" class="easyui-validatebox" placeholder="租户名称">
				</div>
				<div style="margin-top: 30px;">
					<label for="pass">联系人：</label><input type="text" name="linkman" id = "linkman" class="easyui-validatebox" placeholder="联系人">
				</div>
				<div style="margin-top: 30px;">
					<label for="pass">管理员电子邮箱：</label><input type="text" name="username" id = "username" class="easyui-validatebox" placeholder="管理员电子邮箱">
				</div>
				<div style="margin-top: 30px;">
					<label for="pass" >管理员密码：</label><input type="text" name="password" id = "password" class="easyui-validatebox" placeholder="管理员密码">
				</div>
				<div style="margin-left:200px; margin-top: 30px;">
					<button style="width: 100px;height: 40px;" type="button" id = "btn_1" class="easyui-linkbutton" >确定</button>
				</div>
			</div>
		</form>
	</div>
</body>
</html>